//
//  DDDNativeExpressRewardedVideoAd.h
//  DDDDemo
//
//  Created by lishimin on 2020/2/9.
//  Copyright © 2020 summer. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "DDDAdAlertView.h"

NS_ASSUME_NONNULL_BEGIN
@class DDDNativeExpressRewardedVideoAd;


@protocol DDDNativeExpressRewardedVideoAdDelegate <NSObject>

@optional

/// 视频广告素材加载成功回调
/// @param rewardedVideoAd rewardedVideoAd
- (void)nativeExpressRewardedVideoAdDidLoad:(DDDNativeExpressRewardedVideoAd *)rewardedVideoAd;

/// 视频广告缓存成功回调
/// @param rewardedVideoAd rewardedVideoAd
- (void)nativeExpressRewardedVideoAdDidDownLoadVideo:(DDDNativeExpressRewardedVideoAd *)rewardedVideoAd;

/// 视频广告呈现前台成功时回调
/// @param rewardedVideoAd rewardedVideoAd
- (void)nativeExpressRewardedVideoAdViewRenderSuccess:(DDDNativeExpressRewardedVideoAd *)rewardedVideoAd;

/// 视频广告将要显示时调用
/// @param rewardedVideoAd rewardedVideoAd
- (void)nativeExpressRewardedVideoAdWillVisible:(DDDNativeExpressRewardedVideoAd *)rewardedVideoAd;

/// 视频广告显示时调用
/// @param rewardedVideoAd rewardedVideoAd
- (void)nativeExpressRewardedVideoAdDidVisible:(DDDNativeExpressRewardedVideoAd *)rewardedVideoAd;

/// 视频广告将要关闭时回调
/// @param rewardedVideoAd rewardedVideoAd
- (void)nativeExpressRewardedVideoAdWillClose:(DDDNativeExpressRewardedVideoAd *)rewardedVideoAd;

/// 视频广告关闭时回调
/// @param rewardedVideoAd rewardedVideoAd
- (void)nativeExpressRewardedVideoAdDidClose:(DDDNativeExpressRewardedVideoAd *)rewardedVideoAd;

/// 点击视频广告时回调
/// @param rewardedVideoAd rewardedVideoAd
- (void)nativeExpressRewardedVideoAdDidClick:(DDDNativeExpressRewardedVideoAd *)rewardedVideoAd;

/// 点击跳过按钮时的回调
/// @param rewardedVideoAd rewardedVideoAd
- (void)nativeExpressRewardedVideoAdDidClickSkip:(DDDNativeExpressRewardedVideoAd *)rewardedVideoAd;

/// 视频播放完成或出现错误时的回调
/// @param errorCode 错误码
- (void)nativeExpressRewardedVideoAdDidPlayDidFailWithError:(NSInteger)errorCode __attribute__((deprecated("请使用nativeExpressRewardedVideoPlayFailError 来接收错误回调 1.0.0.8以后版本将不再提供该方法")));


/// 播放完成或出现错误时的回调
/// @param errorDic 当code错误码  message错误信息  requestId  用于查询异常原因
- (void)nativeExpressRewardedVideoPlayFailError:(NSDictionary *)errorDic;

@end
@interface DDDNativeExpressRewardedVideoAd : NSObject


@property (nonatomic, weak, nullable) id<DDDNativeExpressRewardedVideoAdDelegate> delegate;

/// 验证视频材料是否有效 -- 当数据不为空且未显示时设置为YES
@property (nonatomic, getter=isAdValid, readonly) BOOL adValid;


/// 初始化
/// @param userId 接入方用户id
- (instancetype)initWithUserId:(NSString *)userId __attribute__((deprecated("请使用init方法初始化 userId统一在初始化sdk时传入  1.0.0.8以后版本将不再提供该方法")));

/// 显示视频广告
/// @param rootViewController 传入当前控制器 用来显示视频和详情页
- (BOOL)showAdFromRootViewController:(UIViewController *)rootViewController;

/// 加载广告数据
- (void)loadAdData;

@property (nonatomic, strong) DDDAdAlertView *loadinageImageView;
@property (nonatomic, strong) DDDAdAlertView *successImageView;
@property (nonatomic, strong) DDDAdAlertView *failureImageView;

@end

NS_ASSUME_NONNULL_END
